package com.sgb.kjwl.di.vehicleManagement;

import com.sgb.kjwl.repository.HomeRepertory;
import com.sgb.kjwl.repository.impl.HomeRepertoryImpl;
import com.sgb.kjwl.view.ui.activity.vehicleManagement.AddDriverInfoActivity;
import com.sgb.kjwl.view.ui.activity.vehicleManagement.AddVehicleActivity;
import com.sgb.kjwl.view.ui.activity.vehicleManagement.DriverInfoActivity;
import com.sgb.kjwl.viewmodel.vehicleManagement.AddDriverAtvModel;
import com.sgb.kjwl.viewmodel.vehicleManagement.AddVehicleAtvModel;
import com.sgb.kjwl.viewmodel.vehicleManagement.DriverInfoAtModel;
import com.swgk.core.base.di.Activity;
import com.swgk.core.base.api.BaseApiSource;
import com.swgk.core.base.model.preference.BasePreferenceSource;

import dagger.Module;
import dagger.Provides;

@Module
public class AddVehicleModule{

    private AddVehicleActivity addVehicleActivity;
    private AddDriverInfoActivity addDriverInfoActivity;
    private DriverInfoActivity driverInfoActivity;

    public AddVehicleModule(AddVehicleActivity addVehicleActivity) {
        this.addVehicleActivity = addVehicleActivity;
    }
    public AddVehicleModule(AddDriverInfoActivity addDriverInfoActivity) {
        this.addDriverInfoActivity = addDriverInfoActivity;
    }
    public AddVehicleModule(DriverInfoActivity driverInfoActivity){
        this.driverInfoActivity=driverInfoActivity;
    }

    @Provides
    @Activity
    HomeRepertory provideHomeRepertory(BaseApiSource apiSource, BasePreferenceSource preferenceSource) {
        return new HomeRepertoryImpl(apiSource, preferenceSource);
    }


    @Provides
    @Activity
    AddVehicleAtvModel provideAddVehicleAtvModel(HomeRepertory repertory) {
        return new AddVehicleAtvModel(addVehicleActivity, repertory);
    }
    @Provides
    @Activity
    AddDriverAtvModel provideAddDriverAtvModel(HomeRepertory repertory) {
        return new AddDriverAtvModel(addDriverInfoActivity, repertory);
    }
    @Provides
    @Activity
    DriverInfoAtModel provideDriverInfoAtModel(HomeRepertory repertory){
        return new DriverInfoAtModel(driverInfoActivity,repertory);
    }

}
